using System.Collections;

 /// <summary>
 /// 单例提供者
 /// </summary>
 /// <typeparam name="T">需要的类</typeparam>
public class singleton<T> where T : new()
{
	singleton() { } 
	public static T Instance
	{
	 	get { return SingletonCreator.instance; }
	}
	
	class SingletonCreator
	{
	 	static SingletonCreator() { }
	 	internal static readonly T instance = new T();
	}
} 
